package lottery;

public class Person {
	
	public Person(int id,String name){
		this( id, name,"");
	}

	
	public Person(int id,String name,String mobile){
		this.id = id;
		this.name = name;
		this.mobile = mobile;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		if(!"".equals(this.name)){
			sb.append(this.name + ",");
		}
		
		if(!"".equals(this.mobile)){
			sb.append(this.mobile + ",");
		}
		String s = sb.toString();
		return "".equals(s) ? "" : s.substring(0, s.length() - 1);
	}

	private int id;
	
	private String name;
	
	private String mobile;
	
	public Person clone(){
		return new Person(this.id,this.name,this.mobile);
	}

}
